const express = require('express')
const path = require('path')
const router = require('./router')
const bodyParser = require('body-parser');
const app = express();

app.listen(3002, () => {
  console.log('服务器启动了');
})
//配置body-parser
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())

app.use('/', express.static(path.join(__dirname, './views')));
app.use(express.static('public'))
app.use(router)